Hi all,
I've been trying to add a trigger to a dialog box element (a checkbox in this case) so that I can change some UI elements depending on whether or not it has been selected. I have no idea how triggers are supposed to work and I've had no luck with the reference manual. Any help with this would be appreciated, my code so far is:
//DXL Export UI Example
/*
Example of new export UI
*/
// prevent dxl timeout dialog
pragma runLim, 0
//Forward function declarations
void Main()
//Globals
DB Main_Dialog
Main()
void confirmer(DB box)
{
string options[] = {(NLS_("Yes")), (NLS_("No"))}
int result = messageBox((NLS_("Cancel the export?")), options, msgWarning_)
if (result == 0)
{
hide box
}
}
void Main()
{
Main_Dialog = create "UI Test"
string dxlCode = "print(\"test text\")"
DBE toggleRun = toggle(Main_Dialog, "Export for test run?", false)
Trigger test = trigger("test", object, post, sync, 10, dxlCode)
string typeRadioBoxes[] = {(NLS_("Single File")), (NLS_("Folder"))}
DBE typeRadioBox = radioBox(Main_Dialog, (NLS_("Export Type:")), typeRadioBoxes, 0)
string structureRadioBoxes[] = {(NLS_("Flat")), (NLS_("Structured"))}
DBE structureRadioBox = radioBox(Main_Dialog, (NLS_("Export Hierarchy:")), structureRadioBoxes, 0)
close(Main_Dialog, true, confirmer)
show Main_Dialog
}
jsjlewis - Mon Mar 13 07:53:11 EDT 2017 |
Re: Triggers on dialog box element You can register a callback to most UI elements:
DBE myCheckbox = ...
void onClick(DBE x) { print "Hallo"; }
set(myCheckbox, onClick)
See also DXL Manual - set(select) under "Common Element Operations". Hope this helps, regards, Mathias |
Re: Triggers on dialog box element Mathias Mamsch - Mon Mar 13 08:36:50 EDT 2017 You can register a callback to most UI elements:
DBE myCheckbox = ...
void onClick(DBE x) { print "Hallo"; }
set(myCheckbox, onClick)
See also DXL Manual - set(select) under "Common Element Operations". Hope this helps, regards, Mathias That makes much more sense in hindsight, thank you very much! |